# -*- coding:utf-8 -*-
class Ren :
    '''人类...'''
    classStr='人类'
    __sex='man'   #私有变量前加__
    def __init__(self):
        print '调用父类默认构造函数'
    def __init__(self,parameter):
        print '调用父类重载构造函数'
        self.name=parameter
    def sayHello(self):
        print '调用父类方法'
        print 'Hello %s'% self.name

class Teacher1 (Ren):
    '''教师类'''
    def __init__(self):
        # super.__init__()
        print '调用子类构造函数'
    # def teach(self,tName):
    #     print '%s 正在上课'%tName
    def teach(self):
        print '%s 正在上课'%self.classStr
    # @classmethod
    # def teach(cls):
    #     print '%s 正在上课' % cls.classStr

#main
# work= Ren('xiaoMing')
teacher1= Teacher1()
teacher1.name='zhangsan'
teacher1.classStr='liSi'
teacher1.sayHello()
teacher1.teach()


